﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace WindowsGame1
{
    /// <summary>
    /// Clase que cargara un sprite
    /// </summary>
    class Balon
    {
        public Vector2 vectorPosicion;

        public Vector2 vectorSize
        {
            get;
            set;
        }

        public Texture2D texturaBalon
        { 
            get; 
            set; 
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="_textura"></param>
        /// <param name="_posicion"></param>
        /// <param name="_tamano"></param>
        public Balon(Texture2D _textura, Vector2 _posicion, Vector2 _tamano)
        {
            texturaBalon = _textura;
            vectorPosicion = _posicion;
            vectorSize = _tamano;
        }

        public void Draw(SpriteBatch _spritebatch)
        {
            _spritebatch.Draw(texturaBalon, vectorPosicion, Color.White);
        }

        public void cargarSprite(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin();
            this.Draw(spriteBatch);
            spriteBatch.End();
        }
        public void mover2DBalon(KeyboardState estadoteclado)
        {
            Keys[] teclaPulsada = estadoteclado.GetPressedKeys();

            foreach (Keys ekey in teclaPulsada)
            {
                if (ekey == Keys.Left)
                {
                    vectorPosicion.X -= 5;
                }

                if (ekey == Keys.Right)
                {
                    vectorPosicion.X += 5;
                }

                if (ekey == Keys.Up)
                {
                    vectorPosicion.Y -= 5;
                }

                if (ekey == Keys.Down)
                {
                    vectorPosicion.Y += 5;
                }
            }
        }
    }
}